package com.lonely.web.controller.order;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.lonely.common.core.domain.TimeLine;
import com.lonely.common.core.domain.api.R;
import com.lonely.order.service.IOrderSecondProcessLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 黄志标
 * @date: 2025/6/24 9:23
 * @description: 二次工艺日志请求处理器
 */
@RestController
@RequestMapping("/orderManager/orderSecondProcessLog")
@Api(tags = "订单管理/二次工艺日志")
public class OrderSecondProcessLogController {

    @Autowired
    private IOrderSecondProcessLogService orderSecondProcessLogService;

    /**
     * 获取指定二次工艺id对应的的日志时间线
     *
     * @param secondProcessId
     * @return
     */
    @GetMapping("/getLogTimeLine/{secondProcessId}")
    @ApiOperation(value = "获取指定订单号的日志时间线")
    @SaCheckPermission("production:orderSecondProcess:log")
    public R<List<TimeLine>> getLogTimeLine(@PathVariable("secondProcessId") Long secondProcessId) {
        return R.data(this.orderSecondProcessLogService.getLogTimeLine(secondProcessId));
    }


}
